/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controle.controladores;

/**
 *
 * @author Taeko
 */
public class derivativo extends ControladorAbstrato{

    private double erroAnterior = 0;
    
    public derivativo(double Kd)
    {
        super(0, 0, Kd);
    }
    
    @Override
    public double valorControle(double leitura, double h)
    {
        double valor = Kd*(leitura - erroAnterior)/h;
        
        erroAnterior = leitura;
        
        return valor;
    }
}
